<!-- header.jsp -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<header>
    <div class="header-container">
        <div class="logo">
            <img src="<c:url value="/static/images/logo.jpg"/>" alt="绿蜂巢农产品系统logo">
            <h1>绿蜂巢农产品系统</h1>
        </div>
        <div class="search-bar">
            <form action="products" method="GET">
                <input type="text" name="keyword" placeholder="搜索农产品..." value="${param.keyword}">
                <button type="submit">搜索</button>
            </form>
        </div>
        <nav>
            <ul class="nav-links">
                <li><a href="http://localhost:8080/fengchao_war_exploded/products">首页</a></li>
                <!-- 仅当用户已登录时显示购物车 -->
                <li><a href="cart.jsp">购物车</a></li>
                <!-- 未登录时显示注册/登录 -->
                <% if (session.getAttribute("user") == null) { %>
                <li><a href="signup.jsp">注册</a></li>
                <li><a href="login.jsp">登录</a></li>
                <% } %>
            </ul>
        </nav>
    </div>
</header>